package com.tanhua.manage.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.manage.mapper.UserMapper;
import com.tanhua.manage.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServcie {
    @Autowired
    private UserMapper userMapper;

    //根据ID搜索用户
    public User selectById(Integer id){
        return this.userMapper.selectById(id);
    }

    //根据条件搜索用户集合
    public List<User> selectList(QueryWrapper<User> queryWrapper){
        return this.userMapper.selectList(queryWrapper);
    }

    //根据条件搜索用户数量
    public Integer selectCount(QueryWrapper<User>queryWrapper){
        return this.userMapper.selectCount(queryWrapper);
    }
}
